/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wanhai.itm.wditm133.vm;

 
import com.wanhai.itm.util.WD_DefaultVM;
import com.wanhai.vo.cus.CUS2061VO;
import java.util.List;
import java.util.Map;
import org.zkoss.bind.annotation.AfterCompose;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.ContextParam;
import org.zkoss.bind.annotation.ContextType;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.Selectors;
import org.zkoss.zul.ListModel;
import org.zkoss.zul.ListModelArray;
 

public class Wditm133VM extends WD_DefaultVM<CUS2061VO> {
     
    private ListModel scTypeList;
    private ListModel scTypeList2;
    
    ///<editor-fold defaultstate="collapsed" desc="binding UI component">
//        @Wire("#infoWin")
//        private Window infoWin;
//        
//        @Wire("#myInc")
//        private Include myInc;
//        
//        @Wire("#ENTRY_USER")
//        private Textbox entryUser;
    
        //</editor-fold>
    
    public Wditm133VM(){
        super(CUS2061VO.class);
    }
        
    @Init
    public void init(){
        String[] scTypeListArray = {"AA","BB","CC"};
        scTypeList = new ListModelArray(scTypeListArray);
        scTypeList2 = new ListModelArray(scTypeListArray);
//        scTypeList = new ListModelList(Arrays.asList(scTypeListArray));
        
//        scTypeList.addAll(Arrays.asList(scTypeListArray));
//        scTypeList.setSelection(Arrays.asList(scTypeListArray));
    }
    
    @Command
    public void choice(@BindingParam("selected") CUS2061VO selected) throws Exception{
        this.setSelected(selected);
    }
    
    
    @Command("lovCallMethod")
//    @NotifyChange("testLOV")
    public void lovCallMethod(@BindingParam("lovRtnList") List<Map> lovList) {
        System.out.println("lovList.size = "+lovList.size());
//        if(callbackObj!=null){
//            this.testLOV = callbackObj.getITEMNO();
//        }
    }
    @Command("lovCallMethod2")
    public void lovCallMethod2(@BindingParam("lovRtnList") List<Map> lovList) {
        System.out.println("22222222 lovList.size = "+lovList.size());
//        if(callbackObj!=null){
//            this.testLOV = callbackObj.getITEMNO();
//        }
    }
    
    
    @AfterCompose
    public void afterCompose(@ContextParam(ContextType.VIEW) Component view){
        Selectors.wireComponents(view, this, false);
    }

    
    
    
    
    //<editor-fold defaultstate="collapsed" desc="getter setter">
    
    
    public ListModel getScTypeList() {
        return scTypeList;
    }

    public void setScTypeList(ListModel scTypeList) {
        this.scTypeList = scTypeList;
    }
    
    public ListModel getScTypeList2() {
        return scTypeList2;
    }

    public void setScTypeList2(ListModel scTypeList2) {
        this.scTypeList2 = scTypeList2;
    }
    //</editor-fold>




}
